<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-registerAgreement-edit" th:object="${registerAgreement}">
            <input id="registerId" name="registerId" th:field="*{registerId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-8">
					<textarea id="tinymceEditor" name="content" th:field="*{content}"></textarea>
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			<div class="form-group" style="text-align: center">
				<div class="col-sm-5"></div>
					<div class="col-sm-1">
						<a class="btn btn-success" style="margin-left: 5px" href="javascript:void(0)" onclick="submitHandler()">保存</a>
					</div>
					<div class="col-sm-1">
						<a class="btn btn-danger" style="margin-left: 5px" href="javascript:void(0)"  onclick="closeItem()">关闭</a>
					</div>
				<div class="col-sm-5"></div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
	<script th:src="@{/ajax/libs/tinymce/4.9.2/tinymce.min.js}"></script>
    <script type="text/javascript">
		var prefix = ctx + "business/registerAgreement";
		$("#form-registerAgreement-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
				var html = tinymce.activeEditor.getContent();
				$("#tinymceEditor").val(html);
	            $.operate.saveModal(prefix + "/edit", $('#form-registerAgreement-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
